import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Shouye from '@/views/shouye.vue'
import Zhaofang from '@/views/zhaofang.vue'
import Wode from '@/views/wode.vue'
import Zixun from '@/views/zixun.vue'
import Login from '@/views/login.vue'
import Register from '@/views/register.vue'
import List from '@/views/list.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: 'shouye',
    children: [
      { path: 'shouye', component: Shouye },
      { path: 'zhaofang', component: Zhaofang },
      { path: 'zixun', component: Zixun },
      { path: 'wode', component: Wode }
    ]
  },
  { path: '/login', component: Login },
  { path: '/register', component: Register },
  { path: '/list', component: List }
]

const router = new VueRouter({
  routes
})

export default router
